<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@taglib uri="/WEB-INF/tld/components.tld" prefix="up"%>
<%@taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="pp" uri="http://java.sun.com/jsp/jstl/fmt"%>
<jsp:useBean id="agora" class="java.util.Date" />
<%@page import="java.util.Iterator"%>
<%@page import="edu.up.beans.SonhoBean"%>
<%@page import="edu.up.controle.Sonho"%>
<%@page import="java.util.ArrayList"%>
<html>
<jsp:include page="header.jsp">
	<jsp:param name="function" value="Sonhos Prontos" />
</jsp:include>
<jsp:useBean id="listaSonhoBean1" scope="request"
	class="edu.up.beans.SonhoBean" />

<body>
<!-- begin #container -->
<div id="container"><!-- begin #header -->
<div id="header">
<div class="headerBackground"></div>
<div id="navcontainer">
<ul id="navlist">
	<li><a href="index.jsp"><up:label property="menu.home" /></a></li>
	<li id="active"><a href="Sonhos.jsp" id="current"><up:label
		property="menu.sonhos" /></a></li>
	<li><a
		href="<%=request.getContextPath()%>/RelatoriosServlet?acao=RelDepoimentos"><up:label
		property="menu.depoimentos" /></a></li>
	<li><a href="Login.jsp"><up:label property="menu.login" /></a></li>
	<li><a href="Sobre.jsp"><up:label property="menu.sobre" /></a></li>
	<li><up:countryOption country="Brasil" locale="pt_BR" /></li>
	<li><up:countryOption country="USA" locale="en_US" /></li>
	<li><up:countryOption country="Espanha" locale="es_ES" /></li>
	<li><a
		href="<%=request.getContextPath()%>/ControleServlet?funcao=Start"><img
		src="images/logout.png" alt="Logout" /></a></li>
</ul>
</div>
</div>
<!-- end #header --> <!-- begin #mainContent -->
<div id="mainContent">
<div class="t">
<div class="b">
<div class="l">
<div class="r">
<div class="bl">
<div class="br">
<div class="tl">
<div class="tr"><up:label property="texto.l68" /> <up:label
	property="texto.l69" /> <up:label property="texto.l70" /> <br />
<br />
<up:label property="texto.l78" />
<form id="frmComprar" name="frmComprar" method="post">

<script>
            function validar(paramAcao)
			{
            //location.href="CarrinhodeCompras.jsp";
            
			document.frmComprar.action="<%=request.getContextPath()%>/SonhoServlet?acao=Comprar";
			document.frmComprar.submit();
			}
            function get_radio_value()
            {
            for (var i=0; i < document.frmComprar.rdId.length; i++)
               {
               if (document.frmComprar.rdId[i].checked)
                  {
                  var rad_val = document.frmComprar.rdId[i].value;
                  alert(rad_val);
                  }
               }
            }
            </script>

<%  
            		ArrayList<SonhoBean> list = (ArrayList<SonhoBean>) request.getAttribute("listaSonhoBean");
            		
            		for (int i = 0; i < list.size(); i++) { %>

<table cellspacing="5" cellpadding="5" border="1" align="center">

	<tr>
		<td colspan="2"><input type="radio" name="rdId" id="rdId"
			value="<%=list.get(i).getId() %>" /><%=list.get(i).getId() %></td>
	</tr>
	<tr>
		<up:label property="texto.l72" />
		<td><input type="text" name="nome"
			value="<%=list.get(i).getLugar()%>" readonly="readonly" /></td>
	</tr>
	<tr>
		<up:label property="texto.l73" />
		<td><input type="text" name="nome"
			value="<%=list.get(i).getData() %>"
			onkeypress="return textPick(this, event)" /></td>
	</tr>
	<tr>
		<up:label property="texto.l74" />
		<td><input type="text" name="nome"
			value="<%=list.get(i).getValor() %>" readonly="readonly" /></td>
	</tr>
	<tr>
		<up:label property="texto.l75" />
		<td><input type="text" name="nome"
			value="<%=list.get(i).getDescricao() %>" readonly="readonly" /></td>
	</tr>
	<tr>
		<td colspan="2"><%=list.get(i).getFoto() %></td>
	</tr>
	<tr>
		<up:label property="texto.l76" />
		<td><input type="text" name="nome"
			value="<%=list.get(i).getFornecedor() %>" readonly="readonly" /></td>

	</tr>

</table>
<br />

<br />
<%  } %>
</form>
<p><input type="button" name="btnComprar"
	value="<up:label property="botao.comprar" />"
	onclick="javascript:validar('Comprar');" /></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

</div>
<!-- end #mainContent --> <!-- begin #footer -->
<div id="footer"><br />
<br />

&nbsp; &nbsp; <strong><pp:formatDate value="${agora}"
	dateStyle="full" /></strong> &nbsp; &nbsp; || &nbsp; &nbsp; <up:label
	property="rodape.texto" /></div>
<!-- end #footer --></div>
<!-- end #container -->
</body>
</html>
